package com.hb.trade.client.project;

import com.hb.core.pojo.parent.PageResult;
import com.hb.core.pojo.project.opening.dto.BidOpeningScheduleDTO;
import com.hb.core.pojo.project.opening.dto.BidOpeningScheduleTemplateDTO;
import com.hb.core.pojo.project.opening.dto.OpeningBidTenderDTO;
import com.hb.core.pojo.project.opening.dto.OpeningSetDTO;
import com.hb.core.pojo.project.opening.entity.BidOpeningSchedule;
import com.hb.core.pojo.project.opening.entity.BidOpeningScheduleTemplate;
import com.hb.core.pojo.project.opening.entity.OpeningBidTender;
import com.hb.core.pojo.project.section.dto.BidSectionDTO;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 开标Feign
 *
 * @author Lix1ang
 * @date 2021-12-10 11:12:51
 */
@FeignClient("hb-project")
public interface BidOpeningClient {

    // ************************************
    //            开标设置 start
    // ************************************

    /**
     * 查询开标设置列表
     *
     * @param openingSet
     * @return
     */
    @PostMapping("/openingSet/pageOpeningSet")
    Message pageOpeningSet(@RequestBody OpeningSetDTO openingSet);

    /**
     * 获取未选择的标段
     *
     * @param openingSet
     * @return
     */
    @PostMapping("/openingSet/getSectionNotSelected")
    Message<PageResult> getSectionNotSelected(@RequestBody OpeningSetDTO openingSet);

    /**
     * 设置监标人
     *
     * @param openSet
     * @return
     */
    @PostMapping("/openingSet/setSupervisor")
    Message setSupervisor(@RequestBody OpeningSetDTO openSet);

    /**
     * 保存开标设置
     *
     * @param openSet
     * @return
     */
    @PostMapping("/openingSet/save")
    Message save(@RequestBody OpeningSetDTO openSet);

    /**
     * 申请开启
     *
     * @param openSet
     * @return
     */
    @PostMapping("/openingSet/openApply")
    Message openApply(@RequestBody OpeningSetDTO openSet);

    /**
     * 开标设置审核
     *
     * @param openSet
     * @return
     */
    @PostMapping("/openingSet/approved")
    Message approved(@RequestBody OpeningSetDTO openSet);

    /**
     * 详情
     *
     * @param id 设置表主键
     * @return
     */
    @PostMapping("/openingSet/detail")
    Message<OpeningSetDTO> detail(@RequestBody OpeningSetDTO openSet);

    /**
     * 开标设置审核列表
     *
     * @param openSet
     * @return
     */
    @PostMapping("/openingSet/applyList")
    Message applyList(OpeningSetDTO openSet);

    // ************************************
    //            开标一览表 start
    // ************************************

    /**
     * 保存该招标文件的开标一览表
     *
     * @return
     */
    @PostMapping("/bidOpeningSchedule/saveSchedulesToBidFile")
    Message<Boolean> saveSchedulesToBidFile(@RequestBody BidOpeningScheduleDTO bidOpeningSchedule);

    /**
     * 查询已保存的常用开标项
     *
     * @return
     */
    @PostMapping("/bidOpeningSchedule/listByFileId")
    Message<List<BidOpeningSchedule>> listByFileId(@RequestParam("fileId") Long fileId, @RequestParam("projectType") Integer projectType);

    /**
     * 查询指定企业ID的常用开标项
     *
     * @return
     * @deprecated 暂时不用
     */
    @Deprecated
    @PostMapping("/bidOpeningSchedule/listBidOpeningSchedulesByOrgId")
    Message<List<BidOpeningSchedule>> listBidOpeningSchedulesByOrgId(Long orgId);

    /**
     * 查询开标一览表的通用模板
     *
     * @return
     */
    @PostMapping("/bidOpeningSchedule/scheduleTemplates")
    Message<List<BidOpeningScheduleTemplate>> scheduleTemplates(@RequestBody BidOpeningScheduleTemplateDTO bidOpeningScheduleTemplateDTO);

    /**
     * 根据标段Id查询开标一览表模板
     *
     * @param bidSectionDTO
     * @return
     */
    @PostMapping("/bidOpeningSchedule/listBySectionId")
    Message<List<BidOpeningSchedule>> listBySectionId(@RequestBody BidSectionDTO bidSectionDTO);

    /**
     * Description: 根据开标标段id获取该标段下的投标人名称（二轮报价处使用）
     * @author: fengbin
     * @date: 2022/2/24 10:32
     * @param sectionId
     @return: java.util.List<java.lang.Long>
     */
    @GetMapping("/openingBidTender/lsitBidderNameBySectionId")
    Message<List<String>> lsitBidderNameBySectionId(@RequestParam("sectionId") Long sectionId);


    /**
     * 根据标段id查询解密成功的投标人
     *
     * @author yuezheng
     * @param sectionId
     * @return List<OpeningBidTender>
     * @date 2022/4/18 1:30 PM
     */
    @PostMapping("/openingBidTender/listBidderDecryptBySectionId")
    Message<List<OpeningBidTender>> listBidderDecryptBySectionId(Long sectionId);

    /**
     * @Description: 开标大厅查询未解密或未确认的投标人
     *
     * @author yuezheng
     * @param openingBidTenderDTO
     * @return List<com.hb.core.pojo.project.opening.entity.OpeningBidTender>
     * @date 2022/6/20 17:33
     */
    @PostMapping("/openingBidTender/listByNotDecryptOrConfirm")
    Message<List<OpeningBidTender>> listByNotDecryptOrConfirm(OpeningBidTenderDTO openingBidTenderDTO);
}
